// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
import 'package:flutter/material.dart';

import 'package:junyeyishu/utils/utils.dart';
import 'package:junyeyishu/widgets/QGWidget.dart';
import 'package:junyeyishu/widgets/QGListState.dart';
import 'widgets/QGOpenBoxRecordItme.dart';

class QGOpenBoxRecordPage extends StatefulWidget {
  String id;
  QGOpenBoxRecordPage({super.key, required this.id});
  @override
  State<QGOpenBoxRecordPage> createState() => _QGOpenBoxRecordPageState();
}

class _QGOpenBoxRecordPageState extends QGListState<QGOpenBoxRecordPage> {
  @override
  void initState() {
    super.initState();

    listURL = url_user_getOpenMysteryboxList;
    listKey = "list";

    onRefresh();
  }

  @override
  Map listParam() {
    return {"pid": widget.id};
  }

  @override
  Widget build(BuildContext context) {
    return QGScaffold(
        title: '开盒记录',
        bgColor: Color(0xFFF8F8F6),
        body: Column(children: [SizedBox(height: 10.rpx), buildList()]));
  }

  @override
  Widget itemBuilder(context, index, data) {
    return QGOpenBoxRecordItem(data: data);
  }
}
